import Https from '@/utils/https'

// 选择结果表（查询该空间下的表列表）
const getTableList = () => Https.get('/api/v1/index/getTableList')
// 数据预览(前10条数据),用于对结果表的预览
const getPreviewData = (params) => Https.get('/api/v1/index/getData', params, { needCode: true })
// 指标关联保存修改取消，取消就是indexCorrelation里面不塞数据
const saveIndexCorrelation = (params) => Https.post('/api/v1/index/saveIndexCorrelation', params)
// 数据血缘 查询lineage
const getLineage = (params) => Https.get('/api/v1/index/getLineage', params)
// 根据结果表查询关联任务
const getAssociatedTasks = (params) => Https.get('/api/v1/index/getAssociatedTasks', params)

export {
  getTableList, getPreviewData, saveIndexCorrelation, getLineage, getAssociatedTasks,
}
